package cn.imokay.classLoad;

public class ClassLoaderTest2 {
    public static void main(String[] args) {
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
        //sun.misc.Launcher$AppClassLoader@18b4aac2
        System.out.println(systemClassLoader);

        ClassLoader extClassLoader = systemClassLoader.getParent();
        //sun.misc.Launcher$ExtClassLoader@3a71f4dd
        System.out.println(extClassLoader);

        ClassLoader bootstrapClassLoader = extClassLoader.getParent();
        //null引导类加载器非java语言写,不在Java语言体系,无法获取到对应对象
        System.out.println(bootstrapClassLoader);

        ClassLoader classLoader = ClassLoaderTest2.class.getClassLoader();
        //sun.misc.Launcher$AppClassLoader@18b4aac2用户自定义类有系统类加载器加载
        System.out.println(classLoader);

        ClassLoader classLoader1 = String.class.getClassLoader();
        System.out.println(classLoader1);//null
    }
}
